package battleship;

/**
 *
 * @author Tomek
 */
public enum ShipType{

	Destroyer, //jednomasztowiec
	Submarine, //dwumasztowiec
	Cruiser, //trzymasztowiec
	Battleship, //czteromasztowiec
	AircraftCarrier; // 5 i więcej masztów

	static ShipType getShip(Integer size) {
		switch (size) {
			case 1:
				return Destroyer;
			case 2:
				return Submarine;
			case 3:
				return Cruiser;
			case 4:
				return Battleship;
			default: {
				if (size > 4)
					return AircraftCarrier;
				return null;
			}
		}
	}
}
